<template>
	<view class="wui-selectionBoxGroup"><slot></slot></view>
</template>

<script>
export default {
	name: 'w-selectionBoxGroup',
	props: {
		value: {
			type: [String, Number,Array]
		}
	},
	watch: {
		value: {
			immediate: true,
			handler(value) {
				this.$nextTick(() => {
					this.deepSetValue();
				});
			}
		}
	},
	methods: {
		changeValue(value) {
			this.$emit('input', value);
		},
		deepSetValue() {
			this.$wuiUtils.queryChilds.call(this, 'w-selectionBox', child => {
				if(this.value instanceof Array){
					child.setGroupValueArr(this.value);
				}else{
					child.setGroupValue(this.value);
				}
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.wui-selectionBoxGroup {
	display: flex;
	align-items: center;
}
</style>
